<template>
  <div class="bg-[#232324] h-[100%]">
    <el-collapse v-loading="loading" v-model="activeNames">
      <el-form label-width="100" :model="states" size="default">
        <el-collapse-item :title="`3D柱状图`" name="i + 1">
          <el-form-item label="x轴轴线">
            <el-switch v-model="states.xAxis3D.axisLine.show" />
          </el-form-item>
          <el-form-item label="x轴刻度">
            <el-switch v-model="states.xAxis3D.axisTick.show" />
          </el-form-item>
          <el-form-item label="x轴标签">
            <el-switch v-model="states.xAxis3D.axisLabel.show" />
          </el-form-item>
          <el-form-item label="x轴分割线">
            <el-switch v-model="states.xAxis3D.splitLine.show" />
          </el-form-item>
          <el-form-item label="x坐标轴名称">
            <el-input v-model="states.xAxis3D.name" />
          </el-form-item>
          <el-form-item label="y轴轴线">
            <el-switch v-model="states.yAxis3D.axisLine.show" />
          </el-form-item>
          <el-form-item label="y轴刻度">
            <el-switch v-model="states.yAxis3D.axisTick.show" />
          </el-form-item>
          <el-form-item label="y轴标签">
            <el-switch v-model="states.yAxis3D.axisLabel.show" />
          </el-form-item>
          <el-form-item label="y轴分割线">
            <el-switch v-model="states.yAxis3D.splitLine.show" />
          </el-form-item>
          <el-form-item label="y坐标轴名称">
            <el-input v-model="states.yAxis3D.name" />
          </el-form-item>
          <el-form-item label="z轴轴线">
            <el-switch v-model="states.zAxis3D.axisLine.show" />
          </el-form-item>
          <el-form-item label="z轴刻度">
            <el-switch v-model="states.zAxis3D.axisTick.show" />
          </el-form-item>
          <el-form-item label="z轴标签">
            <el-switch v-model="states.zAxis3D.axisLabel.show" />
          </el-form-item>
          <el-form-item label="z轴分割线">
            <el-switch v-model="states.zAxis3D.splitLine.show" />
          </el-form-item>
          <el-form-item label="z坐标轴名称">
            <el-input v-model="states.zAxis3D.name" />
          </el-form-item>
        </el-collapse-item>
      </el-form>
    </el-collapse>
  </div>
</template>

<script setup>
import { computed, onMounted, watch, ref } from "vue";
const loading = ref(true);
const activeNames = ref();
const props = defineProps({
  models: {
    type: Object,
    default: () => ({}),
  },
});
const emit = defineEmits(["update:models", "edit"]);
// let states = ref(null);
onMounted(() => {
  setTimeout(() => {
    loading.value = false;
  }, 200);

  // states.value = JSON.parse(JSON.stringify(props.models.series));
});

let states = computed({
  get: () => props.models,
  set: (val) => {
    emit("update:models", val);
  },
});

// watch(
//   () => states.value,
//   (val) => {
//     emit("update:models", { ...props.models, series: val });
//   },
//   {
//     deep: true,
//   }
// );
</script>

<style scoped lang="scss">
:deep(.el-collapse-item__header) {
  padding-left: 10px !important;
}

:deep(.el-input) {
  width: 180px !important;
}
:deep(.el-select) {
  width: 180px !important;
}
</style>
